<script type="text/javascript">
$(document).ready(function(){
  $("ul#gray").Treeview({
    store: true,
    speed: "fast",
    unique: false,
    collapsed: true,
    toggle: function() {
      key = $(this).attr('class');
      opened = $(this).parent().is('.collapsable')?1:0;
      $.cookie(key,opened);
    }
  });
  $("ul#gray ul").each(function(){
    key = $(this).attr('class');
    value = $.cookie(key);
    window.console && console.log && console.log(key+":"+value);
    if(value==1)
      $("."+key).parent().find(">div.hitarea").trigger('click');
  });
});
</script>
<h4><%heading%></h4>
<%tree%>